This notepad demonstrates the use of the HMTK geological tools for preparing fault source models for input into OpenQuake
An active fault model input file contains two sections:
1) A tectonic regionalisation - this can provide a container for a set of properties that may be assigned to multiple faults by virtue of a common tectonic region
2) A set of active faults
In the tectonic regionalisation information each of the three properties can be represented according to a set of weighted values. For example, in the case below faults in an arbitrarily named tectonic region (called here "GEM Region 1") will share the same set of magnitude scaling relations and shear moduli, unless over-written by the specific fault. Those faults assigned to "GEM Region 2" will have the magnitude scaling relation fixed as WC1994 and the shear modulus of 30 GPa
A set of active faults will be defined with a common ID and name.
An active fault set containing a single fault is shown below:
The rupture requires characterisation of the rake (using the Aki & Richards 2002 convention), the slip-type, the slip completeness factor (an integer constraining the quality of the slip information with 1 being the hights quality), the range of slip values and their corresponding weights, and the aseismic slip coefficient (the proportion of slip released aseismically, 1.0 - coupling coefficient)
In [ ]:
%load_ext autoreload
%autoreload 2
import warnings; warnings.filterwarnings('ignore')
In [ ]:
#Import tools
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from openquake.hmtk.plotting.faults.geology_mfd_plot import plot_recurrence_models
from openquake.hazardlib.scalerel.wc1994 import WC1994 # In all the following examples the Wells & Coppersmith (1994) Scaling Relation is Used
The following examples refer to a fault with the following properties:
Length (Along-strike) = 100 km, Width (Down-Dip) = 20 km, Slip = 10.0 mm/yr, Rake = 0. (Strike Slip), Magnitude Scaling Relation = Wells & Coppersmith (1994), Shear Modulus = 30.0 GPa
In [ ]:
# Set up fault parameters
slip = 10.0 # Slip rate in mm/yr
# Area = along-strike length (km) * down-dip with (km)
area = 100.0 * 20.0
# Rake = 0.
rake = 0.
# Magnitude Scaling Relation
msr = WC1994()
This describes a set of distributons where the maximum magnitude is assumed to rupture the whole fault surface
In [ ]:
#Magnitude Frequency Distribution Example
anderson_luco_config1 = {'Model_Name': 'AndersonLucoArbitrary',
'Model_Type': 'First',
'Model_Weight': 1.0, # Weight is a required key - normally weights should sum to 1.0 - current example is simply illustrative!
'MFD_spacing': 0.1,
'Maximum_Magnitude': None,
'Minimum_Magnitude': 4.5,
'b_value': [0.8, 0.05]}
anderson_luco_config2 = {'Model_Name': 'AndersonLucoArbitrary',
'Model_Type': 'Second',
'Model_Weight': 1.0,
'MFD_spacing': 0.1,
'Maximum_Magnitude': None,
'Minimum_Magnitude': 4.5,
'b_value': [0.8, 0.05]}
anderson_luco_config3 = {'Model_Name': 'AndersonLucoArbitrary',
'Model_Type': 'Third',
'Model_Weight': 1.0,
'MFD_spacing': 0.1,
'Maximum_Magnitude': None,
'Minimum_Magnitude': 4.5,
'b_value': [0.8, 0.05]}
# Create a list of the configurations
anderson_luco_arb = [anderson_luco_config1, anderson_luco_config2, anderson_luco_config3]
# View the corresponding magnitude recurrence model
plot_recurrence_models(anderson_luco_arb, area, slip, msr, rake, msr_sigma=0.0)
This describes a set of distributons where the maximum rupture extent is limited to only part of the fault surface
In [ ]:
anderson_luco_config1 = {'Model_Name': 'AndersonLucoAreaMmax',
'Model_Type': 'First',
'Model_Weight': 1.0, # Weight is a required key - normally weights should sum to 1.0 - current example is simply illustrative!
'MFD_spacing': 0.1,
'Maximum_Magnitude': None,
'Minimum_Magnitude': 4.5,
'b_value': [0.8, 0.05]}
anderson_luco_config2 = {'Model_Name': 'AndersonLucoAreaMmax',
'Model_Type': 'Second',
'Model_Weight': 1.0,
'MFD_spacing': 0.1,
'Maximum_Magnitude': None,
'Minimum_Magnitude': 4.5,
'b_value': [0.8, 0.05]}
anderson_luco_config3 = {'Model_Name': 'AndersonLucoAreaMmax',
'Model_Type': 'Third',
'Model_Weight': 1.0,
'MFD_spacing': 0.1,
'Maximum_Magnitude': None,
'Minimum_Magnitude': 4.5,
'b_value': [0.8, 0.05]}
# For these models a displacement to length ratio is needed
disp_length_ratio = 1.25E-5
# Create a list of the configurations
anderson_luco_area_mmax = [anderson_luco_config1, anderson_luco_config2, anderson_luco_config3]
# View the corresponding magnitude recurrence model
plot_recurrence_models(anderson_luco_area_mmax, area, slip, msr, rake, msr_sigma=0.0)
The following example illustrates a "Characteristic" Model, represented by a Truncated Gaussian Distribution
In [ ]:
characteristic = [{'Model_Name': 'Characteristic',
'MFD_spacing': 0.05,
'Model_Weight': 1.0,
'Maximum_Magnitude': None,
'Sigma': 0.15, # Standard Deviation of Distribution (in Magnitude Units) - omit for fixed value
'Lower_Bound': -3.0, # Bounds of the distribution correspond to the number of sigma for truncation
'Upper_Bound': 3.0}]
# View the corresponding magnitude recurrence model
plot_recurrence_models(characteristic, area, slip, msr, rake, msr_sigma=0.0)
The following describes the recurrence from two distributions presented by Youngs & Coppersmith (1985): 1) Exponential Distribution, 2) Hybrid Exponential-Characteristic Distribution
In [ ]:
exponential = {'Model_Name': 'YoungsCoppersmithExponential',
'MFD_spacing': 0.1,
'Maximum_Magnitude': None,
'Maximum_Magnitude_Uncertainty': None,
'Minimum_Magnitude': 5.0,
'Model_Weight': 1.0,
'b_value': [0.8, 0.1]}
hybrid = {'Model_Name': 'YoungsCoppersmithCharacteristic',
'MFD_spacing': 0.1,
'Maximum_Magnitude': None,
'Maximum_Magnitude_Uncertainty': None,
'Minimum_Magnitude': 5.0,
'Model_Weight': 1.0,
'b_value': [0.8, 0.1],
'delta_m': None}
youngs_coppersmith = [exponential, hybrid]
# View the corresponding magnitude recurrence model
plot_recurrence_models(youngs_coppersmith, area, slip, msr, rake, msr_sigma=0.0)
This example considers the fault defined at the top of the page. This fault defines two values of slip rate and two different magnitude frequency distributions
In [ ]:
def show_file_contents(filename):
"""
Shows the file contents
"""
fid = open(filename, 'r')
for row in fid.readlines():
print row
fid.close()
input_file = 'input_data/simple_fault_example_4branch.yml'
show_file_contents(input_file)
In this example each individual MFD for each branch is determined. In the resulting file the fault is duplicated n_branches number of times, with the corresponding MFD multiplied by the end-branch weight
In [ ]:
# Import the Parser
from openquake.hmtk.parsers.faults.fault_yaml_parser import FaultYmltoSource
# Fault mesh discretization step
mesh_spacing = 1.0 # (km)
# Read in the fault model
reader = FaultYmltoSource(input_file)
fault_model, tectonic_region = reader.read_file(mesh_spacing)
# Construct the fault source model (this is really running the MFD calculation code)
fault_model.build_fault_model()
# Write to an output NRML file
output_file_1 = 'output_data/fault_example_enumerated.xml'
fault_model.source_model.serialise_to_nrml(output_file_1)
show_file_contents(output_file_1)
In the following example we implement the same model, this time collapsing the branched. This means that the MFD is discretised and the incremental rate in each magnitude bin is the weighted sum of the rates in that bin from all the end branches of the logic tree.
When collapsing the branches, however, it is necessary to define a single Magnitude Scaling Relation that will need to be assigned to the fault for use in OpenQuake.
In [ ]:
# Read in the fault model
reader = FaultYmltoSource(input_file)
fault_model, tectonic_region = reader.read_file(mesh_spacing)
# Scaling relation for export
output_msr = WC1994()
# Construct the fault source model - collapsing the branches
fault_model.build_fault_model(collapse=True, rendered_msr=output_msr)
# Write to an output NRML file
output_file_2 = 'output_data/fault_example_collapsed.xml'
fault_model.source_model.serialise_to_nrml(output_file_2)
show_file_contents(output_file_2)
In the last example we will take some real fault data from the Gulf of Corinth
In [ ]:
# For plotting
from openquake.hmtk.plotting.mapping import HMTKBaseMap
corinth_fault_file = "input_data/GulfOfCorinth_Faults.yml"
reader = FaultYmltoSource(corinth_fault_file)
corinth_faults, tectonic_region = reader.read_file(mesh_spacing)
print " ID Name Area (km^2)"
for i, fault in enumerate(corinth_faults.faults):
print "%2g %s %25s %10.3f" % (i, fault.id, fault.name, fault.area)
For convenience we will collapse the branches again
In [ ]:
# Scaling relation for export
output_msr = WC1994()
# Construct the fault source model - collapsing the branches
corinth_faults.build_fault_model(collapse=True, rendered_msr=output_msr)
Let's take a look at the fault sources
In [ ]:
map_config = {'min_lon': 20.9, 'max_lon': 24.0,
'min_lat': 37.5, 'max_lat': 39.0, 'resolution':'h'}
# Map the Source
src_basemap = HMTKBaseMap(map_config, "Gulf of Corinth Faults")
src_basemap.add_source_model(corinth_faults.source_model)
In [ ]:
from openquake.hmtk.parsers.catalogue.csv_catalogue_parser import CsvCatalogueParser
from openquake.hmtk.seismicity.selector import CatalogueSelector
# Load in the catalogue
catalogue_file = "input_data/Aegean_ExtendedCat1.csv"
parser = CsvCatalogueParser(catalogue_file)
catalogue = parser.read_file()
print catalogue.get_number_events()
#Create a selector object
selector = CatalogueSelector(catalogue)
xylocastro_fault = corinth_faults.faults[15]
# Select earthquakes within 30 km (rupture distance) of the fault
xylocastro_fault.select_catalogue(selector, 30.0, distance_metric="rupture")
print "%g events with 30 km of the Xylocastro Fault" % xylocastro_fault.catalogue.get_number_events()
Show the events
In [ ]:
map_config = {'min_lon': 20.9, 'max_lon': 24.0,
'min_lat': 37.5, 'max_lat': 39.0, 'resolution':'h'}
# Map the Source
src_basemap = HMTKBaseMap(map_config, "Gulf of Corinth Faults")
src_basemap.add_source_model(corinth_faults.source_model, overlay=True)
src_basemap.add_catalogue(xylocastro_fault.catalogue)
In [ ]:
corinth_output_file = "output_data/New_Gulf_Of_Corinth_Faults.xml"
corinth_faults.source_model.serialise_to_nrml(corinth_output_file)
show_file_contents(corinth_output_file)